﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Negocio;

namespace Presentacion
{
    /// <summary>
    /// Lógica de interacción para Principal.xaml
    /// </summary>
    public partial class Principal : Window
    {
        public Principal()
        {
            InitializeComponent();
            PersistentObject persistentObject = new PersistentObject();
            WPrincipal p = new WPrincipal();
            gridPrincipal.Children.Add(p);
            Club.getInstance().loadTests();
            Club.getInstance().loadEvaluations();            
            Club.getInstance().loadGroups();
            Club.getInstance().loadPlayers();
            Club.getInstance().loadPlayersExecutions();
            Club.getInstance().loadClinicalHistories();
        }


        private void TabItem_GotFocus(object sender, RoutedEventArgs e)
        {
            gridPrincipal.Children.Clear();
            WPlayer wPlayer = WPlayer.getInstance(gridPrincipal);
            gridPrincipal.Children.Add(wPlayer);
        }

        private void TabItem_GotFocus_1(object sender, RoutedEventArgs e)
        {
            WGroups wGroups = WGroups.getInstance();
            gridPrincipal.Children.Clear();
            gridPrincipal.Children.Add(wGroups);
        }

        private void TabItem_GotFocusTest(object sender, RoutedEventArgs e)
        {
            WTest wTest = WTest.getInstance();
            gridPrincipal.Children.Clear();
            gridPrincipal.Children.Add(wTest);

        }


        private void TabItem_GotTestExecution(object sender, RoutedEventArgs e)
        {
            WExecuteTest wExecuteTest = new WExecuteTest(this);
            gridPrincipal.Children.Clear();
            gridPrincipal.Children.Add(wExecuteTest);
        }

        private void tabItemIndividualReport_GotFocus(object sender, RoutedEventArgs e)
        {
            WIndiviudalReport wIndividualReport = new WIndiviudalReport();
            gridPrincipal.Children.Clear();
            gridPrincipal.Children.Add(wIndividualReport);
        }

        private void tabItemGroupReport_GotFocus(object sender, RoutedEventArgs e)
        {
            WGroupReport wGroupReport = new WGroupReport();
            gridPrincipal.Children.Clear();
            gridPrincipal.Children.Add(wGroupReport);
        }

        private void tabItemPlayerEnterData_GotFocus(object sender, RoutedEventArgs e)
        {
            //WPlayersEnterData wPlayerEnterData = new WPlayersEnterData();
            //gridPrincipal.Children.Clear();
            //gridPrincipal.Children.Add(wPlayerEnterData);
        }

        public Grid getGrid()
        {
            return gridPrincipal;
        }
    }
}
